# Contributor: Oleg Titov <oleg.titov@gmail.com>
# Maintainer: Oleg Titov <oleg.titov@gmail.com>
pkgname=py3-cymem
pkgver=2.0.8
pkgrel=3
pkgdesc="Cython memory pool for RAll-style memory management"
url="https://github.com/explosion/cymem"
arch="all"
license="MIT"
makedepends="
	cython
	py3-gpep517
	py3-setuptools
	py3-wheel
	python3-dev
	"
checkdepends="py3-pytest"
subpackages="$pkgname-doc $pkgname-pyc"
source="cymem-$pkgver.tar.gz::https://github.com/explosion/cymem/archive/v$pkgver.tar.gz"
builddir="$srcdir/cymem-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest build/
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl

	rm -r "$pkgdir"/usr/lib/python3*/site-packages/cymem/tests/

	install -Dm644 README.md "$pkgdir/usr/share/doc/$pkgname/README.md"
}

sha512sums="
1428270b67def1a5f4fe94b7958e57c201ac021c6ee40420fab222bb66d99c4dc77db7d794c90c3772f5a2e2a504347928591073e7fa2fd2fa31691899632b38  cymem-2.0.8.tar.gz
"
